﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

using GarageGames.Torque.Core;
using GarageGames.Torque.Util;
using GarageGames.Torque.Sim;
using GarageGames.Torque.T3D;
using GarageGames.Torque.SceneGraph;
using GarageGames.Torque.MathUtil;
using GarageGames.Torque.T3D.RigidCollision;
using GarageGames.Torque.Materials;

namespace TimeWar
{
    public class FriendlyTemplate : AiObjectTemplate
    {

        public FriendlyTemplate() : base()
        {
            TorqueObject objPlayer = TorqueObjectDatabase.Instance.FindObject<TorqueObject>("PlayerObject");
            //Components.FindComponent<AiComponent>().FriendlyName = "FriendlyTemplate";
            //Components.FindComponent<AiComponent>().Friendlies.Add(objPlayer);

            TorqueObjectType friendlyType = TorqueObjectDatabase.Instance.GetObjectType("Friendly");
            ObjectType += friendlyType;

        }

        public void InterpolateTick(float dt)
        {

        }

        public void ProcessTick(Move move, float dt)
        {

        }

        public override void CopyTo(TorqueObject obj)
        {
            base.CopyTo(obj);
            obj.IsTemplate = false;
            //Components.CopyTo(obj.Components);


        }

        public override void OnInProximity(T3DRigidComponent me, T3DRigidComponent you, RigidContactConstraint.Contact[] contacts, int contactCount, float dt)
        {
            TorqueObjectType typeEnemy = TorqueObjectDatabase.Instance.GetObjectType("Enemy");

            if (you.Owner.TestObjectType(typeEnemy))
            {
                Vector3 enemyPosition = you.Components.FindComponent<T3DSceneComponent>().Position;


            }

        }
    }
}
